<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>系统版本号管理 | 系统版本号列表</title>
<@fm.header />
<script>
function doSearch(){    
    $('#tt').datagrid('load', {    
        ver: $('#ver').val(),
        isUseful: $('#isUseful').combobox('getValue')
    });
}
function add(){
    showMyWindow('系统版本号管理 | 新建系统版本号', '/sysver/add', 400, 350);
}
function edit(){
	var row = $('#tt').datagrid('getSelected');
    if (row){
	    showMyWindow('系统版本号管理 | 编辑系统版本号', '/sysver/'+row.ver+'/update', 400, 350);
    } else {
    	showMsg(market.content.title, market.content.tips, alert);
    }
}
function del(){
	var row = $('#tt').datagrid('getSelected');
    if (row){
	   showConfirm(market.content.title, market.content.confirm, function(){
		  $.post('/sysver/'+row.ver+'/delete', function(data) {
		  	if (data.return_code == '1') {
				top.showMsg(market.content.title, data.return_msg, alert);
				$("#tt").datagrid('reload');
			} else {
				$.messager.alert(market.content.title, data.return_msg);
			}
		  });
	   });
    } else {
    	showMsg(market.content.title, market.content.tips, alert);
    }
}

function formatIsUseful(value,row,index){
	if (value==0) {
		return '作废';
	} else {
		return '启用';
	}
}
</script>
</head>
<body class="cmp-list-body">
<div id="tb" style="padding:3px">
    <span>系统版本号:</span>
    <input id="ver" style="line-height:20px;border:1px solid #ccc">
    
    <span>状态:</span>
    <select class="easyui-combobox" id="isUseful" panelHeight="auto" style="width:155px" >
    	<option value="" >全部</option>
        <option value="1" >启用</option>
    	<option value="0" >作废</option>
    </select>
    
    <a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch();">查询</a> 
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="add();">新增</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="del();">删除</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="edit();">修改</a>
</div>
<table id="tt" class="easyui-datagrid" title="系统版本号管理 | 系统版本号列表" iconCls="icon-save" 
	url="/sysver/list?json" toolbar="#tb" rownumbers="true" idField="ver"
	singleSelect="true" pagination="true" fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]"> 
    <thead>
        <tr>
            <th align="center" width="20%" field="ver">系统版本号</th>
            <th align="center" width="30%" field="verDesc">备注</th>
            <th align="center" width="30%" field="isUseful" formatter="formatIsUseful">状态</th>
            <th align="center" width="20%" field="createTime">创建时间</th>
            <th align="center" width="20%" field="modifyTime">更新时间</th>
        </tr>
    </thead>   
</table>
</body>
</html>